/*tid.c*/  
#include <pthread.h>  
#include <stdio.h>  
#include <unistd.h>  

void *t1_exe(void *arg) {  
    printf("In new created thread\n");  
    printf("My pid is %d and my pthread is %d\n", getpid(), (unsigned int)pthread_self());  
    return NULL;  // 显式返回，遵循线程函数规范  
}  

int main() {  
    pthread_t pid1;  
    int error1;  
    error1 = pthread_create(&pid1, NULL, t1_exe, NULL);  
    if (error1 != 0) {  
        printf("pthread_create failed ");  
        return -1;  // 规范错误处理返回值  
    }  
    printf("In main process\n");  
    printf("My pid is %d and my pthread is %d\n", getpid(), (unsigned int)pthread_self());  
    pthread_join(pid1, NULL);  
    return 0;  // 主函数规范返回值  
}  
